package  
{
	import de.dev_lab.logging.Logger;
	import de.dev_lab.logging.publisher.MultiPublisher;
	import de.dev_lab.logging.publisher.SOSPublisher;
	import de.dev_lab.logging.publisher.TextFieldPublisher;
	
	import flash.display.Sprite;
	import flash.events.TimerEvent;
	import flash.text.TextField;
	import flash.utils.Timer;	

	/**
	 *
	 * @author Sebastian Weyrauch 
	 *
	 * LastChanged:
	 * 
	 * $Author: sebastian.weyrauch $
	 * $Revision: 10 $
	 * $LastChangedDate: 2010-07-04 18:34:28 +0000 (Sun, 04 Jul 2010) $
	 * $URL: http://as3logger.googlecode.com/svn/trunk/as3logger/test/Test.as $
	 * 
	 */
	public class Test extends Sprite
	{
		private var _timer : Timer;
		
		public function Test ()
		{
			var field : TextField = TextFieldPublisher.getLoggerField();
			addChild ( field );
			
			Logger.publisher = new MultiPublisher ( [ new SOSPublisher, new TextFieldPublisher ( field ) ] );
			
			Logger.info( "It works" );
			Logger.debug ( { x: 1 , y: 2, z: 3}, [ 4 , 5 , 6 ] , "message" );
			Logger.info ( new SomeVO );
			Logger.info ( new Date ( 2009 , 10 , 5 ) );
			Logger.warn ( null );
			
			_timer = new Timer ( 500 );
			_timer.addEventListener ( TimerEvent.TIMER , onTimer );
			_timer.start();
		}
		
		private function onTimer ( event : TimerEvent ) : void
		{
			//Logger.debug( "count" , _timer.currentCount , { id: 5, id : "test" } , [ 1 , 2 , 3 ] );
		}
	}
}

internal class SomeVO
{
	public var x : int = 4;
	public var y : int = 5;
	
	public function SomeVO ()
	{
	}
}